package com.yalemang.photovalut.base.encryption;

import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;

public abstract class Result<T> implements Observer<T> {
    @Override
    public void onSubscribe(@NonNull Disposable d) {

    }

    @Override
    public void onNext(@NonNull T t) {
        result(t);
    }

    @Override
    public void onError(@NonNull Throwable e) {
       error(e);
    }

    @Override
    public void onComplete() {

    }

    public abstract void result(T t);

    public void error(Throwable e){

    }
}
